<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template basic_vectorstream</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../interprocess/indexes_reference.html#doxygen.boost_interprocess_header_reference.vectorstream_8hpp" title="Header &lt;boost/interprocess/streams/vectorstream.hpp&gt;">
<link rel="prev" href="classboost_1_1interprocess_1_1basic__vectorbuf.html" title="Class template basic_vectorbuf">
<link rel="next" href="classboost_1_1interprocess_1_1file__lock.html" title="Class file_lock">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
<td align="center"><a href="../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="classboost_1_1interprocess_1_1basic__vectorbuf.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../interprocess/indexes_reference.html#doxygen.boost_interprocess_header_reference.vectorstream_8hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="classboost_1_1interprocess_1_1file__lock.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1basic__vectorstream"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template basic_vectorstream</span></h2>
<p>boost::interprocess::basic_vectorstream</p>
</div>
<h2 class="refsynopsisdiv-title">Synopsis</h2>
<div class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../interprocess/indexes_reference.html#doxygen.boost_interprocess_header_reference.vectorstream_8hpp" title="Header &lt;boost/interprocess/streams/vectorstream.hpp&gt;">boost/interprocess/streams/vectorstream.hpp</a>&gt;

</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> CharVector<span class="special">,</span> <span class="keyword">typename</span> CharTraits<span class="special">&gt;</span> 
<span class="keyword">class</span> <a class="link" href="classboost_1_1interprocess_1_1basic__vectorstream.html" title="Class template basic_vectorstream">basic_vectorstream</a> <span class="special">:</span>
  <span class="keyword">public</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_iostream</span><span class="special">&lt;</span> <span class="identifier">CharVector</span><span class="special">::</span><span class="identifier">value_type</span><span class="special">,</span> <span class="identifier">CharTraits</span> <span class="special">&gt;</span>
<span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// types</span>
  <span class="keyword">typedef</span> <span class="identifier">CharVector</span>                                                              <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1basic__vectorstream_1a986e8b0d4979cf782cad3f5d760e212a"></a><span class="identifier">vector_type</span><span class="special">;</span>
  <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ios</span><span class="special">&lt;</span> <span class="identifier">typenameCharVector</span><span class="special">::</span><span class="identifier">value_type</span><span class="special">,</span> <span class="identifier">CharTraits</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">char_type</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1basic__vectorstream_1a008be025861b7c269ada9084b250ba22"></a><span class="identifier">char_type</span><span class="special">;</span>  
  <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ios</span><span class="special">&lt;</span> <span class="identifier">char_type</span><span class="special">,</span> <span class="identifier">CharTraits</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">int_type</span>                       <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1basic__vectorstream_1a08164c8bda3eb264dcc886adac74d967"></a><span class="identifier">int_type</span><span class="special">;</span>   
  <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ios</span><span class="special">&lt;</span> <span class="identifier">char_type</span><span class="special">,</span> <span class="identifier">CharTraits</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">pos_type</span>                       <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1basic__vectorstream_1ad7b306daa84816941a5460630bc24318"></a><span class="identifier">pos_type</span><span class="special">;</span>   
  <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ios</span><span class="special">&lt;</span> <span class="identifier">char_type</span><span class="special">,</span> <span class="identifier">CharTraits</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">off_type</span>                       <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1basic__vectorstream_1ae00138536d02e113eb5be78c8e879172"></a><span class="identifier">off_type</span><span class="special">;</span>   
  <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ios</span><span class="special">&lt;</span> <span class="identifier">char_type</span><span class="special">,</span> <span class="identifier">CharTraits</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">traits_type</span>                    <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1basic__vectorstream_1aa2757efe95f28155dbcc0bb9435d99ad"></a><span class="identifier">traits_type</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="../boost_container_header_reference/classboost_1_1container_1_1pmr_1_1memory__resource.html#id75-bb">public member functions</a></span>
  <a class="link" href="classboost_1_1interprocess_1_1basic__vectorstream.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1basic__vectorstream_1a27e9ab170508d087cf9ac0ec85a0a6e4"><span class="identifier">basic_vectorstream</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">openmode</span> <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">in</span><span class="special">|</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">out</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> VectorParameter<span class="special">&gt;</span> 
    <a class="link" href="classboost_1_1interprocess_1_1basic__vectorstream.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1basic__vectorstream_1a70ba3ad4d49a1cefbcd1b18309e4a879"><span class="identifier">basic_vectorstream</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">VectorParameter</span> <span class="special">&amp;</span><span class="special">,</span> 
                       <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">openmode</span> <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">in</span><span class="special">|</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">out</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="classboost_1_1interprocess_1_1basic__vectorbuf.html" title="Class template basic_vectorbuf">basic_vectorbuf</a><span class="special">&lt;</span> <span class="identifier">CharVector</span><span class="special">,</span> <span class="identifier">CharTraits</span> <span class="special">&gt;</span> <span class="special">*</span> <a class="link" href="classboost_1_1interprocess_1_1basic__vectorstream.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1basic__vectorstream_1a315dcffa225d7bd0e50a0292f21f9c47"><span class="identifier">rdbuf</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1interprocess_1_1basic__vectorstream.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1basic__vectorstream_1a5c7f7eb019a129de09556e5fd924db6c"><span class="identifier">swap_vector</span></a><span class="special">(</span><span class="identifier">vector_type</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">const</span> <span class="identifier">vector_type</span> <span class="special">&amp;</span> <a class="link" href="classboost_1_1interprocess_1_1basic__vectorstream.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1basic__vectorstream_1a80ce0d8c64b7e0f7fdd2b09e7380c64d"><span class="identifier">vector</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1interprocess_1_1basic__vectorstream.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1basic__vectorstream_1ae7457b17a3c82d1404418e86035416e7"><span class="identifier">reserve</span></a><span class="special">(</span><span class="keyword">typename</span> <span class="identifier">vector_type</span><span class="special">::</span><span class="identifier">size_type</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1interprocess_1_1basic__vectorstream.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1basic__vectorstream_1ade39ce926842330eb0de681360277083"><span class="identifier">clear</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="id-1.3.16.19.3.55.7.4"></a><h2>Description</h2>
<p>A basic_iostream class that holds a character vector specified by CharVector template parameter as its formatting buffer. The vector must have contiguous storage, like std::vector, boost::interprocess::vector or boost::interprocess::basic_string </p>
<div class="refsect2">
<a name="id-1.3.16.19.3.55.7.4.3"></a><h3>
<a name="id75-bb"></a><code class="computeroutput">basic_vectorstream</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1basic__vectorstream_1a27e9ab170508d087cf9ac0ec85a0a6e4"></a><span class="identifier">basic_vectorstream</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">openmode</span> mode <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">in</span><span class="special">|</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">out</span><span class="special">)</span><span class="special">;</span></pre>
<p>Constructor. Throws if vector_type default constructor throws. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> VectorParameter<span class="special">&gt;</span> 
  <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1basic__vectorstream_1a70ba3ad4d49a1cefbcd1b18309e4a879"></a><span class="identifier">basic_vectorstream</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">VectorParameter</span> <span class="special">&amp;</span> param<span class="special">,</span> 
                     <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">openmode</span> mode <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">in</span><span class="special">|</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">ios_base</span><span class="special">::</span><span class="identifier">out</span><span class="special">)</span><span class="special">;</span></pre>
<p>Constructor. Throws if vector_type(const VectorParameter &amp;param) throws. </p>
</li>
<li class="listitem"><pre class="literallayout"><a class="link" href="classboost_1_1interprocess_1_1basic__vectorbuf.html" title="Class template basic_vectorbuf">basic_vectorbuf</a><span class="special">&lt;</span> <span class="identifier">CharVector</span><span class="special">,</span> <span class="identifier">CharTraits</span> <span class="special">&gt;</span> <span class="special">*</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1basic__vectorstream_1a315dcffa225d7bd0e50a0292f21f9c47"></a><span class="identifier">rdbuf</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1basic__vectorstream_1a5c7f7eb019a129de09556e5fd924db6c"></a><span class="identifier">swap_vector</span><span class="special">(</span><span class="identifier">vector_type</span> <span class="special">&amp;</span> vect<span class="special">)</span><span class="special">;</span></pre>
<p>Swaps the underlying vector with the passed vector. This function resets the read/write position in the stream. Does not throw. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">const</span> <span class="identifier">vector_type</span> <span class="special">&amp;</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1basic__vectorstream_1a80ce0d8c64b7e0f7fdd2b09e7380c64d"></a><span class="identifier">vector</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Returns a const reference to the internal vector. Does not throw. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1basic__vectorstream_1ae7457b17a3c82d1404418e86035416e7"></a><span class="identifier">reserve</span><span class="special">(</span><span class="keyword">typename</span> <span class="identifier">vector_type</span><span class="special">::</span><span class="identifier">size_type</span> size<span class="special">)</span><span class="special">;</span></pre>
<p>Calls <a class="link" href="classboost_1_1interprocess_1_1basic__vectorstream.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1basic__vectorstream_1ae7457b17a3c82d1404418e86035416e7">reserve()</a> method of the internal vector. Resets the stream to the first position. Throws if the internals vector's reserve throws. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1basic__vectorstream_1ade39ce926842330eb0de681360277083"></a><span class="identifier">clear</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p>Calls <a class="link" href="classboost_1_1interprocess_1_1basic__vectorstream.html#doxygen.boost_interprocess_header_reference.classboost_1_1interprocess_1_1basic__vectorstream_1ade39ce926842330eb0de681360277083">clear()</a> method of the internal vector. Resets the stream to the first position. </p>
</li>
</ol></div>
</div>
</div>
</div>
<div class="copyright-footer">Copyright © 2005-2024 Ion Gaztanaga<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="classboost_1_1interprocess_1_1basic__vectorbuf.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../interprocess/indexes_reference.html#doxygen.boost_interprocess_header_reference.vectorstream_8hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="classboost_1_1interprocess_1_1file__lock.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
